import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Home from "../components/Home"
import Product from "../components/Product"

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    }, {
      //当访问 /home 的时候 访问name所指向的页面
      path: '/home',
      name: "Home",
      component: Home
    }, {
      path: '/product/:id',  //设置参数
      name: "Product",
      component: Product
    }
  ]
})
